package ys.com;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import ys.com.config.AppConfig;

//@RestController
@EnableAutoConfiguration
@SpringBootApplication
public class DemoApplication{

//    @RequestMapping("/")
//    String home() {
//        return "Hello World!"+appConfig.getProfiles();
//    }
    @Bean
    @ConfigurationProperties(prefix = "connection")
    public AppConfig connectionSettings(){
        return new AppConfig();
    }

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }
}